package com.hm.kafkademo.consumer;

import com.alibaba.fastjson2.JSON;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class HmConsumer1 {
//    @KafkaListener(containerFactory = "firstKafkaListenerContainerFactory",
//            topics = {"PSPC_APE"},
//            groupId = "testGroup1")
//    public void consumer(ConsumerRecord<String, String> record) throws JsonProcessingException {
//        //获取报文
//        log.info("--------------PSPC_APE----------报文信息----------------：{} ......", JSON.toJSONString(record.value()));
//    }
}
